<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%@ page import=" com.sfxy.form.*" %>
<%@ page import="com.sfxy.dao.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>显示论文列表</title>
	<style type="text/css">
    
	<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	width:806px;
	height:600px;
}
body,td,th {
	font-family: 新宋体;
	color: #660000;
}
.STYLE1{
	font-family: "新宋体";
	font-size: 12px;
	color: #660000;
}

-->
    </style></head>
 <jsp:useBean id="pageset" class="com.sfxy.tool.PageSet" scope="session"></jsp:useBean> 
 <jsp:useBean id="susdao" class="com.sfxy.dao.SubjectDao"  scope="session"></jsp:useBean>
 <%
 	String str=request.getParameter("Page");
 	String stamp=(String)session.getAttribute("stamp");//冲页面中获取类型信息
 	String username=(String)session.getAttribute("username");
 	int Page=1;
 	int pagesize=15;
 	List list=null;
 	if(str==null){
     list=susdao.exquerySearchSubjectname(username,stamp);
  	 list=pageset.getInitPage(list,Page,pagesize);
  	 }else{
  	 	Page=pageset.getPage(str);
  	 	list=pageset.getAppointPage(Page);
  	 }
 
  %>

  <body>
 <form name="formfomr" method="get" >
 <input type="hidden"  id="jsmessage" name="message"  />
 <input type="hidden" id="ids" name="ids" />
  <table  width="796"  border="5" cellpadding="3" cellspacing="1"  background="images/back_r2_c2.jpg" class="STYLE1">
  	
  	<tr>
	  <td colspan="8" ><%
  		if(pageset.getrecordSize()<=0){
		out.print("<p align=center><img src=images/icon.gif width=10 height=10 >&nbsp;&nbsp;<strong>暂时还没有系统题目录入!</strong></p>");}
		else{
		  out.println("<p align=center>&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;所有题目列表信息!</p>");}
  	 %></td>
  	  <td align="right"><input type="button"name="returnmain" align="right" value="返回主页" onclick="javascript:location.href='MyJsp.jsp'; " />	
	  </td>
    </tr>
    <tr >
      <td width="74" height="30"><strong>教师编号</strong></td>
      <td width="74"><strong>教师姓名</strong></td>
      <td width="74"><strong>题目编号</strong></td>
      <td width="74"><strong>题目名称</strong></td>
      <td width="190" align="center"><strong>题目说明</strong></td>
      <td width="74"><strong>学生编号</strong></td>
      <td width="74"><strong>学生姓名</strong></td>
      <td colspan="2"align="center"><strong>执行操作</strong></td>
    </tr>
	<%
		for(int i=0;i<list.size();i++){
			
			 SubjectForm formb=(SubjectForm)list.get(i);
			// System.out.println(form.getStname());
	 %>
    <tr>
      <td ><%=formb.getTeacherId() %> 
      	<input type="hidden" name="TeacherId" value="<%=formb.getTeacherId() %>">
      </td>
      <td><%=formb.getName() %></td>
      <td><%=formb.getSubjectId() %>
      	<input type="hidden" name="SubjectId" value="<%=formb.getSubjectId() %>"> 
      </td>
     	
      <td><%=formb.getTitle() %></td>
      <td><%=formb.getIntroduce() %></td>
      <td><%=formb.getStudentId() %>
      	<input type="hidden" name="StudentId" value="<%=formb.getStudentId() %>"> 
      </td>
      <td><%=formb.getStname() %>
      	<input type="hidden" name="Stname" value="<%=formb.getStname() %>"> 
      </td>
      <td width="50">
      
	       <input type="button" name="add" value="选择" onClick="checkForm('add',<%=formb.getSubjectId() %>);">
	       
	      </td>
	      <td width="50"><input type="button" name="delete" value="取消" onClick="checkForm('delete',<%=formb.getSubjectId() %>);"></td>
    </tr>
    <%} %>
  </table>
   	<%=pageset.printCtrl(Page) %>
  
 </form>
  </body>
</html>
<script type="text/javascript" >

      function checkForm(f,v){
      document.getElementById("jsmessage").value=f;
       document.getElementById("ids").value=v;
      formfomr.action="SearchServlet";
      	formfomr.submit();
      }
      
      </script>
